var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = cc._decorator,
    s = r.ccclass,
    c = r.property,
    p =
        (r.menu,
        (function (t) {
            i(e, t);
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                e.labCount = null;
                e.viewSprite = null;
                e.moveTime = 1;
                e.oldPos = null;
                return e;
            }
            e.prototype.onLoad = function () {};
            e.prototype.setMoveTime = function (t) {
                this.moveTime = t;
            };
            e.prototype.setRewardKind = function (t) {
                SpriteView.setRewardCoin(t, this.viewSprite);
            };
            e.prototype.play = function (t, e, o, a) {
                var i = this,
                    n = cc.v2(this.node.position);
                this.labCount.string = o;
                var r = e.add(n).mul(0.5);
                r.x -= 500;
                this.setRewardKind(a);
                this.node.scale = 0.8;
                this.node.opacity = 255;
                this.node.runAction(cc.fadeIn(0.6));
                this.oldPos || (this.oldPos = this.labCount.node.position);
                this.labCount.node.setPosition(this.oldPos);
                this.labCount.node.opacity = 255;
                this.labCount.node.active = !0;
                var s = this.viewSprite.node.position;
                this.viewSprite.node.scale = 0.4;
                this.labCount.node.runAction(
                    cc.sequence([cc.delayTime(2), cc.spawn(cc.moveBy(0.6, cc.v2(0, 100)), cc.fadeOut(0.6))])
                );
                this.viewSprite.node.runAction(
                    cc.spawn(
                        cc.sequence([
                            cc.moveTo(0.2, cc.v2(s.add(cc.v3(0, 50)))),
                            cc.moveTo(1, cc.v2(s.add(cc.v3(0, 0)))).easing(cc.easeBounceOut())
                        ]),
                        cc.scaleTo(0.8, 1)
                    )
                );
                this.node.runAction(
                    cc.sequence(
                        cc.delayTime(2 + 0.05 * t),
                        cc.callFunc(function () {}, this),
                        cc.spawn([
                            cc.scaleTo(this.moveTime, 1).easing(cc.easeBackOut()),
                            cc.bezierTo(this.moveTime, [n, r, e]).easing(cc.easeIn(3))
                        ]),
                        cc.callFunc(function () {
                            i.node.scale = 0;
                        }, this),
                        cc.delayTime(2.5),
                        cc.callFunc(function () {
                            i.node.scale = 1;
                            i.viewSprite.node.setPosition(s);
                            QLooperNode.putNode(i.node);
                        }, this)
                    )
                );
            };
            n([c(cc.Label)], e.prototype, "labCount", void 0);
            n([c(cc.Sprite)], e.prototype, "viewSprite", void 0);
            return n([s], e);
        })(cc.Component));
o.default = p;
